package com.gr.springboot_shiro.utils;

import java.io.Serializable;
import java.util.Random;

public class SaltUtils implements Serializable {
    public static String getSalt(int n) {
        char[] chars = "bakfbaowbfjkabofbaCCUVUIVIWDKV%$&^%*&*%$1131415".toCharArray(); //转换为字符数组
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < n; i++) {
            char ch = chars[new Random().nextInt(chars.length)];
            stringBuilder.append(ch);
        }
        return stringBuilder.toString();
    }
}

